﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace PDO.DataPersistence.ServiceProvider
{
    [global::System.Serializable]
    public class DataObjectSourceException : Exception
    {
        //
        // For guidelines regarding the creation of new exception types, see
        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp
        // and
        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp
        //

        public DataObjectSourceException() { }
        public DataObjectSourceException(string message) : base(message) { }
        public DataObjectSourceException(string message, Exception inner) : base(message, inner) { }
        protected DataObjectSourceException(
          System.Runtime.Serialization.SerializationInfo info,
          System.Runtime.Serialization.StreamingContext context)
            : base(info, context) { }      
        
        public string SqlErrorMessage { get; set; }

        public override string ToString()
        {
            return base.ToString() + Environment.NewLine + "SQL Error Message: " + Environment.NewLine + SqlErrorMessage;
        }
    }

}
